<?php

use App\Http\Controllers\Store\Sponsor\SponsorController;
use App\Http\Controllers\Store\User\RanchController;
use App\Http\Controllers\Store\User\UserController;
use Illuminate\Support\Facades\Route;

// 用户
Route::group(['prefix' => 'user', 'namespace' => 'User'], function () {
    Route::post('register', [UserController::class, 'register']);           // 注册
    Route::post('login', [UserController::class, 'login']);                 // 登录
    Route::post('resetPassword', [UserController::class, 'resetPassword']); // 忘记密码

    Route::group(['middleware' => 'storeAuth'], function () {
        Route::get('ranchList', [RanchController::class, 'list']);            // 牧场列表
    });
});

// 认养管理
Route::group(['prefix' => 'sponsor', 'namespace' => 'Sponsor'], function () {
    Route::get('list', [SponsorController::class, 'list']);                             // 认养列表
    Route::get('detail', [SponsorController::class, 'detail']);                         // 认养详情
    Route::get('expressCompanyList', [SponsorController::class, 'expressCompanyList']); // 快递公司列表

    Route::post('upload', [SponsorController::class, 'upload']);                           // 上传图片
    Route::post('grantIntegral', [SponsorController::class, 'grantIntegral']);             // 发放积分
    Route::post('createExpress', [SponsorController::class, 'createExpress']);             // 发放快递
});
